﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TJDevHouse.Starcraft.Game
{
	/// <summary>
	/// A force of players (aka team...)
	/// </summary>
	public class Force
	{
		/// <summary>
		/// The players on this force.
		/// </summary>
		public Dictionary<int, Player> Players { get; private set; }

		/// <summary>
		/// The name of this force.
		/// </summary>
		public string Name { get; private set; }

		/// <summary>
		/// The game this force is in.
		/// </summary>
		public Game Game { get; set; }

		public Force(string name)
		{
			Name = name;

			Players = new Dictionary<int, Player>();
		}

		/// <summary>
		/// Add a player to this force.
		/// </summary>
		/// <param name="player"></param>
		public void AddPlayer(Player player)
		{
			if (!Players.ContainsKey(player.ID))
			{
				player.Force = this;
				Players.Add(player.ID, player);
			}
		}
	}
}
